package org.kl.bf.entity.basic;

import javax.persistence.Entity;
import javax.persistence.Table;

import org.kl.bf.entity.AuditableEntity;
import org.kl.bf.entity.Excel;
import org.kl.bf.utils.BasicConstants;

//JPA标识
@Entity
@Table(name = "basic_code_table")
public class CodeTable extends AuditableEntity {
	private static final long serialVersionUID = -1739725463792863556L;

	@Excel(exportName = "表名称")
	private String tableName;
	@Excel(exportName = "标识码")
	private String tableCode;
	@Excel(exportName = "是否启用", exportConvertSign = 1)
	private Integer enable;
	// @Excel(exportName = "备注")
	private Integer editable;

	public CodeTable() {
	}

	public CodeTable(String id) {
		this.id = id;
	}

	public String getTableCode() {
		return tableCode;
	}

	public void setTableCode(String tableCode) {
		this.tableCode = tableCode;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public Integer getEnable() {
		return enable;
	}

	public void setEnable(Integer enable) {
		if (enable == null) {
			this.enable = BasicConstants.NO_INT;
		} else {
			this.enable = enable;
		}
	}

	public Integer getEditable() {
		return editable;
	}

	public void setEditable(Integer editable) {
		this.editable = editable;
	}

	public String enableConvert() {
		return enable == 1 ? "是" : "否";
	}

}
